-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for snapshot 24w04a (1.20.5) #3602
Conversation
thoughts: maybe add transfer api and cookie api, also maybe provide config options to decline transfers |
Notice: if you want to test with an vanilla server (i think there are no spigot snapshot build) you need to change the uniqueId in
|
@md-5 i thought about the transfer api, should we store a cookie inside the client like "bungeecord:transfer" with a json as data like the BungeeCord version and build number and a timestamp, before we sent the transfer packet to the player? Whats your opinion on this one? |
I personally see no reason for this. |
Using |
what exactly do you mean? |
the cookie packets are present in game login and config phase and the transfer packet witch api is only after login state is registered for configuration and game phase, its not possible that the packet is in the wrong phase as its registered for all phases that can occour |
I guess this only applies if bungee is online mode? Should probably look into this and if it can be supported without an option as Bungee should support vanilla. |
I don't think that's necessary, but there should be an API |
Yes only for online mode, for offline mode it works fine as the uuids are the same, in online mode i think some signatures are broken in some packets because of the uuid difference |
…only is useable in Config and Game state
@md-5 you can achieve vanilla compatibility by dropping the Chat Session packet if enforce secure profile is set to false in bungee, if you do, you also can send messages to the server, but when the message is sent from the server to all clients they will show this: |
If we do the fix you initially mentioned does the chat error show? |
as i remember it does not show |
Can you please check? And then perhaps make a separate PR but replace |
Okay i can do it when i am home in like 2 hours |
No rush |
nah i forget i got my laptop on me, i tested, its working |
Based on an initial review, looks good to me. Well done! |
What do you guys think about adding an Player Transfer Event, so we can cancel transfers by the backend server? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks really good. Some minor comments.
api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java
Outdated
Show resolved
Hide resolved
protocol/src/main/java/net/md_5/bungee/protocol/packet/CookieResponse.java
Outdated
Show resolved
Hide resolved
protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java
Outdated
Show resolved
Hide resolved
@Override | ||
public void storeCookie(String cookie, byte[] data) | ||
{ | ||
Preconditions.checkState( getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_20_5, "Cookies are only supported in 1.20.5 and above" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to discuss - whether we should force a namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for storeCookie, we don't need to as the client creates a "minecraft:" namespace if no namespace is sent, thats why i added "minecraft:" as default namespace for retrieveCookie so we can run code like this without any issues, because for the CookieRequest it doesn't do that
player.storeCookie("test", "Outfluencer".getBytes());
player.retrieveCookie("test").thenAccept((data) -> {
player.sendMessage(new String(data));
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I know. But maybe for good API we want to force a namespace
Thanks! FYI I made some minor changes to the cookie handling in InitialHandler to make it properly thread safe given it's a future and may commonly be used async. Please let me know if any concerns. |
Should we add an isTransferred to PendingConnection ? |
related to #3601
if you spot bugs please report